﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace DFGK_WMS.Context.Migrations
{
    public partial class 新增单位类型 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "TDepartmentOwners");

            migrationBuilder.DropColumn(
                name: "Signature",
                table: "TUsers");

            migrationBuilder.DropColumn(
                name: "UserSecret",
                table: "TUsers");

            migrationBuilder.AddColumn<int>(
                name: "DepartmentTypeId",
                table: "TDepartments",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "DepartmentTypeName",
                table: "TDepartments",
                type: "nvarchar(max)",
                nullable: true);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "DepartmentTypeId",
                table: "TDepartments");

            migrationBuilder.DropColumn(
                name: "DepartmentTypeName",
                table: "TDepartments");

            migrationBuilder.AddColumn<string>(
                name: "Signature",
                table: "TUsers",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "UserSecret",
                table: "TUsers",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.CreateTable(
                name: "TDepartmentOwners",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    DepartmentId = table.Column<int>(type: "int", nullable: true),
                    OwnerId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TDepartmentOwners", x => x.Id);
                });
        }
    }
}
